#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "CoreData/CoreData.h"
#import "Define.h"
#import "UserDataManager.h"
//#import "FBLoginManager.h"
//#import "TWLoginManager.h"
//#import "FBFunLoginManager.h"
#import "SplashScreenViewController.h"
#import "RequestPopupView.h"
#import "HomeViewController.h"
#import "KIDBAWAdvertisementManager.h"

#import "UIDevice-Hardware.h"
#import <AudioToolbox/AudioServices.h>
#import <MediaPlayer/MediaPlayer.h>

#import <MessageUI/MFMailComposeViewController.h>
#import <Twitter/TWTweetComposeViewController.h>

@interface AppViewController : UIViewController <RequestPopupViewDelegate, KIDBAWAdvertisementProtocol, MFMailComposeViewControllerDelegate> {
    APIRequester                                    *_APIRequester;
    
    UIView                                          *_requestingView;
    UIActivityIndicatorView                         *_requestingIndicator;
    RequestPopupView                                *_requestPopUpView;
    
    NSTimer                                         *_timerCountDown;
    
    UIView                                          *_notificationView;
    UILabel                                         *_notificationMessageLbl;
}
@property (nonatomic) NSTimeInterval                                                backgroundTimeInterval;
@property (nonatomic) int                                                           remainingTime;
@property (nonatomic, readonly) NSMutableArray                                      *listOfViewController;
@property (nonatomic, retain) UIPopoverController                                   *popoverControllerMain;

+ (AppViewController *)Shared;

#pragma mark - Indicator view animation
- (void)isRequestingAndShouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
- (void)isRequesting:(BOOL)isRe andRequestType:(ENUM_API_REQUEST_TYPE)type andFrame:(CGRect)frame;

#pragma mark - App Protocol
- (void)update;

#pragma mark - UserID & DeviceUDID & DeviceToken
-(void)requestUpdateUserID_Or_DeviceUDID_Or_DeviceToken;

#pragma mark - HomeViewController
- (void)changeToHomeFromWelcomeScreen:(BOOL)isFromLogin;
- (void)changeBackToHome;

#pragma mark - SplashScreenViewController
- (void)changeToSplashScreen;
- (void)changeBackFromSplashScreen;

#pragma mark - MainPageViewController
- (void)changeToMainPageViewController;
- (void)changeBackFromMainPageViewController;

#pragma mark - FEEDBACK
- (void)changeToFeedbackVCWithEmailAddress:(NSString *)emailAddress;
- (void)changeBackToPreviousViewController;

//#pragma mark - Facebook & Twitter
//- (void)changeToFacebookViewController;
//- (void)changeBackFromFacebookViewController;
//- (void)changeToTwitterViewController;
//- (void)changeBackFromTwitterViewController;

#pragma mark - FOREGROUND & BACKGROUND
- (void)applicationDidEnterBackground:(UIApplication *)application;
- (void)applicationWillEnterForeground:(UIApplication *)application;

#pragma mark - LOCAL NOTIFICATION
- (void)scheduleNotificationWithAlertDate:(NSDate*)date andAlertMessage:(NSString *)message;
- (void)showNotificationWithMessage:(NSString *)message andIsShowed:(BOOL)isShowed;

#pragma mark - REMOTE NOTIFICATION
- (void)didReceiveRemoteNotification:(NSDictionary *)userInfo andNotificationType:(enumRemoveNotificationType)type;

#pragma mark - UIImage Picker View Controller
- (void)changeToPickerControllerWithSourceType:(UIImagePickerControllerSourceType)type andDelegate:(id<UINavigationControllerDelegate, UIImagePickerControllerDelegate>)delegate;
- (void)changeBackFromPickerController;

@end
